package servlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.alibaba.fastjson.JSON;

import dao.DeleteMmessageDao;
import dao.SelectProduct_CommentByusernameDao;
import dao.impl.DeleteMmessageDaoImpl;
import dao.impl.SelectProduct_CommentByusernameDaoImpl;
import entity.Product_Comment;

/**
 * Servlet implementation class DeleteMmessageServlet
 */
public class DeleteMmessageServlet extends HttpServlet {
	private DeleteMmessageDao remove = new DeleteMmessageDaoImpl();
	private SelectProduct_CommentByusernameDao spcm =new  SelectProduct_CommentByusernameDaoImpl();
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		request.setCharacterEncoding("utf-8");
		response.setContentType("text/html;charset=utf-8");		
		String comment_id = request.getParameter("comment_id");		
		int comment_idInt = Integer.parseInt(comment_id);
	//	String user_id = request.getParameter("user_id");		
		//int user_idInt = Integer.parseInt(user_id);
		System.out.println(comment_idInt);
		Integer removeTheAddress = remove.RemoveTheAddress(comment_idInt);
		response.getWriter().print(JSON.toJSONString(2));
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
	}

}
